{
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
- return ((GTK_WIDGET_FLAGS (wid) & GTK_VISIBLE) != 0 &&
- (GTK_WIDGET_FLAGS (wid) & GTK_MAPPED) != 0);
+ return ((GTK_WIDGET_FLAGS (widget) & GTK_VISIBLE) != 0 &&
+ (GTK_WIDGET_FLAGS (widget) & GTK_MAPPED) != 0);
}
/**
widget->allocation = *allocation;
}
+/**
+ * gtk_widget_set_window:
+ * @widget: a #GtkWidget
+ * @window: a #GdkWindow
+ *
+ * Sets a widget's window. This function should only be used in a
+ * widget's GtkWidget::realize() implementation. The %window passed is
+ * usually either new window created with gdk_window_new(), or the
+ * window of its parent widget as returned by
+ * gtk_widget_get_parent_window().
+ *
+ * Widgets must indicate whether they will create their own #GdkWindow
+ * by calling gtk_widget_set_has_window(). This is usually done in the
+ * widget's init() function.
+ *
+ * Since: 2.18
+ */
+void
+gtk_widget_set_window (GtkWidget *widget,
+ GdkWindow *window)
+{
+ g_return_if_fail (GTK_IS_WIDGET (widget));
+ g_return_if_fail (window == NULL || GDK_IS_WINDOW (window));
+
+ if (widget->window != window)
+ {
+ widget->window = window;
+ g_object_notify (G_OBJECT (widget), "window");
+ }
+}
+
/**
* gtk_widget_get_window:
* @widget: a #GtkWidget
void gtk_widget_set_child_visible (GtkWidget *widget,
gboolean is_visible);
gboolean gtk_widget_get_child_visible (GtkWidget *widget);
-GdkWindow* gtk_widget_get_window (GtkWidget *widget);
+
+void gtk_widget_set_window (GtkWidget *widget,
+ GdkWindow *window);
+GdkWindow * gtk_widget_get_window (GtkWidget *widget);
void gtk_widget_get_allocation (GtkWidget *widget,
GtkAllocation *allocation);